package com.waypolice.common.quartz;

import com.waypolice.common.utils.ApplicationContextUtil;
import com.waypolice.manager.service.BorMyService;
import com.waypolice.manager.service.BorRegisterService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 描述:
 *
 * @author zyp
 * @description 更新登记记录状态job
 * @create 2019-05-31 10:16
 */
public class UpdateRegistJob {

    private static Logger logger = LoggerFactory.getLogger(UpdateRegistJob.class);

    /**
     * @author:zyp
     * @description 更新登记记录的过期状态（每天凌晨更新）
     * @date: 2019/5/31 10:18
     * @return 
     */
    public void updateRegist(){
        /*借阅登记记录service*/
        BorRegisterService borRegisterService = (BorRegisterService) ApplicationContextUtil.getBean(BorRegisterService.class);
        /*我的借阅 修改我的借阅中已过期的线上借阅*/
        BorMyService borMyService = (BorMyService) ApplicationContextUtil.getBean(BorMyService.class);
        //更新借阅状态 线下超过三天没有领取的，修改为已失效。
        borRegisterService.updateBorStatusTo2();
        //更新检索状态，当前检索已经成功的，并且超过检索期限的，修改为已过期。
        borRegisterService.updateSearchStatusTo3();
        //更新线上借阅的借阅状态为已过期
        borMyService.updateBorStatusUP(null);
    }

}